import { APIPCPREFIX } from '@/common';
import { request } from '../request';

// 获取选择的企业/协会人数
export const getObjPersonNum = (params: any) =>
  request({
    url: `${APIPCPREFIX}aiPlanTask/getDriverNumber`,
    params,
    method: 'get',
  });

// 选择AI学习内容列表
export const getAiContList = (params: any) =>
  request({
    url: `${APIPCPREFIX}classManage/aiClassificationList`,
    params,
  });

// 选择学习对象列表
export const getStudyObjList = (params: any) =>
  request({
    url: `${APIPCPREFIX}aiPlanTask/learnObjectList`,
    params,
    method: 'get',
  });

// 添加AI学习计划
export const addAiPlanTask = (data: any) =>
  request({
    url: data.aiPlanId ? `${APIPCPREFIX}aiPlanTask/edit` : `${APIPCPREFIX}aiPlanTask/add`,
    data,
  });

// 获取AI学习详情
export const getAiDetail = (params: any) =>
  request({
    url: `${APIPCPREFIX}aiPlanTask/details`,
    params,
    method: 'get',
  });
// 开启关闭AI学习
export const switchStatus = (params: any) =>
  request({
    url: `${APIPCPREFIX}aiPlanTask/updateOpenStatus`,
    params,
    method: 'get',
  });
// 删除AI 学习
export const delAiPlan = (params: any) => {
  request({
    url: `${APIPCPREFIX}aiPlanTask/delete`,
    params,
    method: 'get',
  });
};

export const exportStudyCardList = (data: any) => {
  return request<Blob>({
    method: 'post',
    url: `${APIPCPREFIX}studyCard/exportStatisticsStudyCardListNew`,
    data,
    responseType: 'blob',
  });
};
